package a66weding.com.jiehuntong.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

import org.xutils.x;

import a66weding.com.jiehuntong.R;
import a66weding.com.jiehuntong.common.utils.ImageOptionsUtil;
import a66weding.com.jiehuntong.fragment.homeproduct.ProductBaseFragment;

/**
 * Created by admin on 2016/8/4.
 */
public class StoreMyListAdapter extends BaseAdapter {
    private Context context;
    private String[] url;
    public StoreMyListAdapter(Context context,String[] url){
        this.context = context;
        this.url = url;
    }
    @Override
    public int getCount() {
        return url.length;
    }

    @Override
    public Object getItem(int position) {
        return url[position];
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder vh;
        if (convertView==null){
            convertView = View.inflate(context, R.layout.item_mylist,null);
            vh = new ViewHolder();
            vh.iv = (ImageView) convertView.findViewById(R.id.home_iv);
            convertView.setTag(vh);
        }else{
            vh = (ViewHolder) convertView.getTag();
        }

        x.image().bind(vh.iv,url[position], ImageOptionsUtil.getOptions292_700());
        return convertView;
    }
    public class ViewHolder {
        ImageView iv;
    }
}
